14-Break statement Example 1.py


Sign up Free. Don't forget to check out our challenges, lessons, solve and learn series and more ...


Code Snippet


found=False
for x in range(1,11):
    if x == 1:
        found=True
        break #this exits the loop
    else:
        print(x)
    
                    

Try it yourself